In the field of computer technologies, a virtualization technology is a technology for combining or dividing existing computer resources so that the resources are represented as one or multiple operating environments, thereby providing an access mode better than that of an original resource configuration.
As shown in FIG. 1, a virtualized environment mainly includes a virtual machine (VM) and a Hypervisor. The virtualized environment is based on a physical environment. That is, to implement the virtualization technology, a physical host needs to provide a basis for running the virtualized environment. The virtual machine is a complete software-simulated computer system. It has complete hardware system functions and runs in a virtualized environment. In the virtualized environment, the hypervisor is configured to manage the virtual machine, and forward data transmitted by the virtual machine, where forwarding data transmitted by the virtual machine may be implemented by a virtual switch in the hypervisor, as shown by a solid-line transmission path shown in FIG. 1. During data processing of the virtual machine, including socket creation and protocol processing, data after protocol processing is transmitted to the virtual switch through a virtual network interface card (Virtual NIC) and transmitted to a physical network interface card through the virtual switch. Forwarding data transmitted by the virtual machine may also be that the virtual network interface card directly transmits processed data to the physical network interface card, as shown by a dashed-line transmission path in FIG. 1.
In the virtualized environment, a protocol processing function is generally set in the virtual machine and is referred to as a protocol stack in the virtual machine. Because virtual machines are isolated from each other, protocol stacks in the virtual machines are also isolated from each other and cannot be shared. That is, a protocol stack in virtual machine A cannot serve virtual machine B. In addition, due to isolation of the virtual machines, the virtual machines cannot share a network processing capability of a same physical host. Therefore, in this case, due to mutual isolation of the protocol stacks in the virtual machines, load imbalance of the protocol stacks leads to a poor protocol processing capability, and a protocol stack having a poor protocol processing capability may become a bottleneck of a corresponding virtual machine. For example, as shown in FIG. 1, during data processing, protocol stack A in virtual machine #1 bears extremely heavy load and is already 100% fully loaded, while protocol stack B in virtual machine #2 is 50% loaded, and protocol stack C in virtual machine #3 is 10% loaded. However, during protocol processing, protocol stack A cannot use a protocol processing capability provided by protocol stack C or protocol stack B. After data is allocated to protocol stack A, protocol stack A can only run in an overloaded state to perform protocol processing or cannot perform protocol processing.
In conclusion, in the virtualized environment, when processing data, multiple virtual machines cannot share a network protocol processing capability of a physical host, and in a case in which protocol stacks of some virtual machines are heavily loaded, system reliability is poor.